//
//  DKAuthHeadStepInfoCell.m
//  DanKU
//
//  Created by 吴斌 on 2023/10/29.
//

#import "DKAuthHeadStepInfoCell.h"
#import "DKAuthSecurityView.h"
static NSString * DKAuthHeadStepInfoCellId = @"DKAuthHeadStepInfoCellId";
@interface DKAuthHeadStepInfoCell()
@property (nonatomic, strong)UILabel * dk_AuthBaseInfoLab;
@property (nonatomic, strong)UILabel * dk_AuthStepInfoLab;
@property (nonatomic, strong)UILabel * dk_AuthAllStepLab;
@property (nonatomic, strong)DKAuthSecurityView *dk_AuthSecurityView;
@end
@implementation DKAuthHeadStepInfoCell
+ (instancetype)authHeadStepInfoCell:(UITableView *)tableView{
    DKAuthHeadStepInfoCell * dk_AuthHeadStepInfoCell = [tableView dequeueReusableCellWithIdentifier:DKAuthHeadStepInfoCellId];
    if (!dk_AuthHeadStepInfoCell) {
        dk_AuthHeadStepInfoCell = [[DKAuthHeadStepInfoCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:DKAuthHeadStepInfoCellId];
    }
    dk_AuthHeadStepInfoCell.backgroundColor = [UIColor clearColor];
    dk_AuthHeadStepInfoCell.selectionStyle = UITableViewCellSelectionStyleNone;
    dk_AuthHeadStepInfoCell.accessoryType = UITableViewCellAccessoryNone;
    return dk_AuthHeadStepInfoCell;
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self dk_addSubView];
    }
    return self;
}
- (void)dk_addSubView{
    self.dk_AuthBaseInfoLab = [[UILabel alloc] init];
    self.dk_AuthBaseInfoLab.textColor = DK_Hex(@"#333333");
    self.dk_AuthBaseInfoLab.text = @"Basic information";
    self.dk_AuthBaseInfoLab.font = DK_FONT_Medium(17);
    [self addSubview:self.dk_AuthBaseInfoLab];
    [self.dk_AuthBaseInfoLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(DK_IsWidthScale(30)));
        make.top.equalTo(@(DK_IsWidthScale(63)+DK_SafeAreaTop));
        make.height.equalTo(@(DK_IsWidthScale(24)));
    }];
    self.dk_AuthStepInfoLab = [[UILabel alloc] init];
    self.dk_AuthStepInfoLab.textColor = DK_Hex(@"#4566FF");
    self.dk_AuthStepInfoLab.font = DK_FONT_Regular(17);
    [self addSubview:self.dk_AuthStepInfoLab];
    [self.dk_AuthStepInfoLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.dk_AuthBaseInfoLab.mas_right).offset(DK_IsWidthScale(10));
        make.height.equalTo(@(DK_IsWidthScale(19)));
        make.centerY.equalTo(self.dk_AuthBaseInfoLab);
    }];
    self.dk_AuthAllStepLab = [[UILabel alloc] init];
    self.dk_AuthAllStepLab.textColor = DK_Hex(@"#333333");
    self.dk_AuthAllStepLab.font = DK_FONT_Regular(17);
    self.dk_AuthAllStepLab.text = @"/3";
    [self addSubview:self.dk_AuthAllStepLab];
    [self.dk_AuthAllStepLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.dk_AuthStepInfoLab.mas_right);
        make.height.equalTo(self.dk_AuthStepInfoLab);
        make.centerY.equalTo(self.dk_AuthStepInfoLab);
    }];
    self.dk_AuthSecurityView = [[DKAuthSecurityView alloc] init];
    [self addSubview:self.dk_AuthSecurityView];
    [self.dk_AuthSecurityView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(@(-DK_IsWidthScale(30)));
        make.height.equalTo(@(DK_IsWidthScale(17)));
        make.centerY.equalTo(self.dk_AuthAllStepLab);
    }];
}
-(void)setDk_AuthStep:(NSString *)dk_AuthStep{
    _dk_AuthStep = dk_AuthStep;
    if([_dk_AuthStep isEqualToString:@"1"]||[_dk_AuthStep isEqualToString:@"2"]||[_dk_AuthStep isEqualToString:@"3"]){//basic
        self.dk_AuthBaseInfoLab.text = @"Basic information";
        self.dk_AuthStepInfoLab.text = _dk_AuthStep;
        self.dk_AuthAllStepLab.text = @"/3";
        if([_dk_AuthStep isEqualToString:@"3"]){
            self.dk_AuthAllStepLab.textColor = DK_Hex(@"#4566FF");
        }else{
            self.dk_AuthAllStepLab.textColor = DK_Hex(@"#333333");
        }
    }else if([_dk_AuthStep isEqualToString:@"4"]){
        self.dk_AuthBaseInfoLab.text = @"Contacts";
        self.dk_AuthStepInfoLab.text = @"1";
        self.dk_AuthAllStepLab.text = @"/1";
        self.dk_AuthAllStepLab.textColor = DK_Hex(@"#4566FF");
    }else if([_dk_AuthStep isEqualToString:@"5"]){
        self.dk_AuthBaseInfoLab.text = @"Bank card";
        self.dk_AuthStepInfoLab.text = @"1";
        self.dk_AuthAllStepLab.text = @"/1";
        self.dk_AuthAllStepLab.textColor = DK_Hex(@"#4566FF");
    }
}
@end
